import { http } from "@/plugin/http"

// 获取forge列表
export const getForgeList = async (params: API.Forge.ForgeListParams) => {
  try {
    return await http.post<API.Forge.ForgeListResponse>('/forge/list', params);
  } catch (error) {
    return null;
  }
}

// Forge详情
export const getForgeDetail = async (params: API.Forge.ForgeDetailParams) => {
  try {
    return await http.post<API.Forge.ForgeItem>('/forge/detail', params);
  } catch (error) {
    return null;
  }
}

// 开启Forge
export const openForge = async (params: API.Forge.ForgeOpenParams) => {
  try {
    return await http.post<API.Forge.ForgeOpenResponse>('/forge/spin', params);
  } catch (error) {
    return null;
  }
}

// 开启Forge-demo
export const openForgeDemo = async (params: API.Forge.ForgeOpenParams) => {
  try {
    return await http.post<API.Forge.ForgeOpenResponse>('/forge/spin-demo', params);
  } catch (error) {
    return null;
  }
}
